package com.example.springboottest.async.service.impl;

import com.example.springboottest.async.service.AsyncTestService;
import org.springframework.stereotype.Service;

@Service("asyncTestService")
public class AsyncTestServiceImpl implements AsyncTestService {
    @Override
    public void doLongTimeWork() {
        System.out.println("开始进入doLongTimeWork异步方法");
        try {
            System.out.println("线程名【" + Thread.currentThread().getName() + "】");
            Thread.sleep(10 * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("异步方法doLongTimeWork执行完毕");
    }
}
